package com.house.user.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * TUserRight entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "t_user_right")
public class TUserRight implements java.io.Serializable {

	// Fields

	private Integer userRightId;
	private User user;
	private Right right;
	private String rightType;

	// Constructors

	/** default constructor */
	public TUserRight() {
	}

	/** full constructor */
	public TUserRight(User user, Right right, String rightType) {
		this.user = user;
		this.right = right;
		this.rightType = rightType;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name = "user_right_id", unique = true, nullable = false)
	public Integer getUserRightId() {
		return this.userRightId;
	}

	public void setUserRightId(Integer userRightId) {
		this.userRightId = userRightId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id", nullable = false)
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "right_id", nullable = false)
	public Right getRight() {
		return this.right;
	}

	public void setRight(Right right) {
		this.right = right;
	}

	@Column(name = "right_type", nullable = false, length = 2)
	public String getRightType() {
		return this.rightType;
	}

	public void setRightType(String rightType) {
		this.rightType = rightType;
	}

}